function getWeixinShareData(dataUrl, shareUrl) {
    var currentUrl= shareUrl? shareUrl : location.href.split("#")[0],
         url = encodeURIComponent(location.href.split("#")[0]),
         imgUrl= currentDomain() + '/share.jpg';

    console.log(currentUrl);
    console.log(url);
    $.ajax({
        url: dataUrl,
        type: "post",
        cache: !1,
        dataType: "json",
        async: !1,
        data: { url: url },
        error: function () {
        },
        success: function (data) {
            wx.config({
                debug: false,
                appId: data.appId,
                timestamp: data.timestamp,
                nonceStr: data.nonceStr,
                signature: data.signature,
                jsApiList: ["onMenuShareTimeline", "onMenuShareAppMessage"]
            }),
                wx.ready(function () {
                    wx.onMenuShareTimeline({
                        title: '掌声四起邀您做《好文大赛》评委',
                        link: currentUrl,
                        imgUrl: imgUrl,
                        success: function () {
                        },
                        cancel: function () {
                        }
                    }),
                        wx.onMenuShareAppMessage({
                            title: '掌声四起邀您做《好文大赛》评委',
                            desc:  '掌声四起邀您做《好文大赛》评委 ',
                            link: currentUrl,
                            imgUrl: imgUrl,
                            success: function () {
                            },
                            cancel: function () {
                            }
                        })
                }),
                wx.error(function (res) {
                })
        }
    })
}

function currentDomain() {
   return window.location.protocol + '//' + window.location.host;
}